/*************************************************************************
	> File Name: main.cpp
	> Author: ma6174
	> Mail: ma6174@163.com 
	> Created Time: 2021年11月15日 星期一 22时56分29秒
 ************************************************************************/

#include<iostream>
#include "symbol.h"
using namespace std;

class Fac
{
public:
	static Operation* create(double a, double b, char c)
	{
		Operation* oper;
		switch (c)
		{
			case '+':

			case '-':
				{
					oper = new Sub(a, b);
					return oper;
					break;
				}
			case '*':
				{
					oper = new Mul(a, b);
					return oper;
					break;
				}
			case '/':
				{
					oper = new Div(a, b);
					return oper;
					break;
				}
		}
	}
};

int main()
{
	double a;
	double b;
	cout << "请输入数字A:" << endl;
	cin >> a;
	cout << "请输入数字B:" << endl;
	cin >> b;
	cout << "请输入运算符号:" << endl;
	char c;
	cin >> c;
	Operation* res = Fac::create(a, b, c);
	cout << "计算结果: " << res->getResult() << endl;
	return 0;
}
